'use strict';

function get_letter_interval_2(number_a, number_b) {
  let arr=[];
  if(number_a < number_b){
    for(let i=number_a;i<=number_b;i++){
      if(i<=26){
        arr.push(String.fromCharCode(i+96));
      }
      else {
        if(i%26===0){
          arr.push(String.fromCharCode(i/26-1+96)+String.fromCharCode(26+96));
        }
        else {
          arr.push(String.fromCharCode(parseInt(i/26)+96)+String.fromCharCode(i%26+96));
        }
      }
    }
  }
  else if(number_a > number_b){
    for(let i=number_a;i>=number_b;i--){
      if(i<=26){
        arr.push(String.fromCharCode(i+96));
      }
      else {
        if(i%26===0){
          arr.push(String.fromCharCode(i/26-1+96)+String.fromCharCode(26+96));
        }
        else {
          arr.push(String.fromCharCode(parseInt(i/26)+96)+String.fromCharCode(i%26+96));
        }
      }
    }
  }
  else {
    if(number_a<=26){
      arr.push(String.fromCharCode(number_a+96));
    }
    else {
      if(number_a%26===0){
        arr.push(String.fromCharCode(number_a/26-1+96)+String.fromCharCode(26+96));
      }
      else {
        arr.push(String.fromCharCode(parseInt(number_a/26)+96)+String.fromCharCode(number_a%26+96));
      }
    }
  }
  return arr;
}

module.exports = get_letter_interval_2;

